﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace NotAClue.Web.DynamicData
{
    /// <summary>
    /// This class is used like an interface
    /// so that when the DynamicLinkControl control
    /// is loaded it can be case as DynamicLinkControlInterface
    /// to gain access to its properties
    /// </summary>
    public class DynamicLinkControlInterface : System.Web.UI.UserControl
    {
        public string Text
        {
            get
            {
                if (ViewState["text"] != null)
                {
                    return ViewState["text"].ToString();
                }
                else
                {
                    return null;
                }
            }

            set
            {
                ViewState["text"] = value;
            }
        }

        public string NavigateUrl
        {
            get
            {
                if (ViewState["navigateUrl"] != null)
                {
                    return ViewState["navigateUrl"].ToString();
                }
                else
                {
                    return null;
                }
            }

            set
            {
                ViewState["navigateUrl"] = value;
            }
        }

        public string Action
        {
            get
            {
                if (ViewState["action"] != null)
                {
                    return ViewState["action"].ToString();
                }
                else
                {
                    return null;
                }
            }

            set
            {
                ViewState["action"] = value;
            }
        }

        public string TableName
        {
            get
            {
                if (ViewState["table"] != null)
                {
                    return ViewState["table"].ToString();
                }
                else
                {
                    return null;
                }
            }

            set
            {
                ViewState["table"] = value;
            }
        }

        public string ContextTypeName
        {
            get
            {
                if (ViewState["context"] != null)
                {
                    return ViewState["context"].ToString();
                }
                else
                {
                    return null;
                }
            }

            set
            {
                ViewState["context"] = value;
            }
        }

        public string CssClass
        {
            get
            {
                if (ViewState["CssClass"] != null)
                {
                    return ViewState["CssClass"].ToString();
                }
                else
                {
                    return null;
                }
            }

            set
            {
                ViewState["CssClass"] = value;
            }
        }

        public string ToolTip
        {
            get
            {
                if (ViewState["ToolTip"] != null)
                {
                    return ViewState["ToolTip"].ToString();
                }
                else
                {
                    return null;
                }
            }

            set
            {
                ViewState["ToolTip"] = value;
            }
        }

        public string ImageUrl
        {
            get
            {
                if (ViewState["imageUrl"] != null)
                {
                    return ViewState["imageUrl"].ToString();
                }
                else
                {
                    return null;
                }
            }

            set
            {
                ViewState["imageUrl"] = value;
            }
        }
    }
}